package cn.zhibang.sannuo.repoty.service.impl;

import cn.zhibang.sannuo.commons.model.*;
import cn.zhibang.sannuo.repoty.dao.RcustomerDao;
import cn.zhibang.sannuo.repoty.service.RcustomerServices;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public class RcustomerServicesImpl implements RcustomerServices {

    @Autowired
    private RcustomerDao rcustomerDao;

    /**
     * 指标总览
     * @return
     */
    @Override
    public List<Customer> selIndexSum(@Param("cname") String cname, @Param("cphone") String cphone, @Param("bname") String bname, @Param("hname") String hname) {
        return rcustomerDao.selIndexSum(cname, cphone, bname, hname);
    }

    /**
     * 分店名
     * @return
     */
    @Override
    public List<BranchOffice> selBname() {
        return rcustomerDao.selBname();
    }

    /**
     * 总店名
     * @return
     */
    @Override
    public List<HeadOffice> selHname() {
        return rcustomerDao.selHname();
    }

    /**
     * 统计异常人数
     * @param sex
     * @param month
     * @return
     */
    @Override
    public Integer getMityCount(String sex, Integer month) {
        return rcustomerDao.mityCount(sex, month);
    }

    /**
     * 平均年龄
     * @return
     */
    @Override
    public Integer getAvgAge() {
        return rcustomerDao.avgAge();
    }

    /**
     * 异常人次
     */
    @Override
    public Integer getMitySum() {
        return rcustomerDao.mitySum();
    }

    /**
     * 总人数
     */
    @Override
    public Integer getSumCount() {
        return rcustomerDao.sumCount();
    }

    /**
     * 消费者检查频次排行
     * @return
     */
    @Override
    public List<Ccudetails> queryConsumerCount() {
        return rcustomerDao.queryConsumerCount();
    }


    //    总店下所有分店
    @Override
    public List<BranchOffice> queryBnameInHname() {
        return rcustomerDao.queryBnameInHname();
    }

    //    各个分店下的总人数
    @Override
    public List<Customer> queryBnameSum() {
        return rcustomerDao.queryBnameSum();
    }

    @Override
    public List<Map<String, Object>> queryIndexAnomaly() {
        return rcustomerDao.queryIndexAnomaly();
    }

    //总店下所有分店
    @Override
    public List<BranchOffice> queryHnameContentBname(String hname) {
        return rcustomerDao.queryHnameContentBname(hname);
    }

    //查询所有指标
    @Override
    public List<Cudetails> queryCudname() {
        return rcustomerDao.queryCudname();
    }

    //各个分店的总检查人数
    @Override
    public List<Map<String, Object>> queryCountByBname() {
        return rcustomerDao.queryCountByBname();
    }


}
